package com.maruping.disk.user.service;

import com.maruping.disk.mybatis.entity.PtUserEntity;
import com.maruping.disk.mybatis.flexigrid.PagingEntity;
import com.maruping.disk.mybatis.flexigrid.TblResponseEntity;
import com.maruping.disk.mybatis.ztree.ZtreeEntity;
import com.maruping.disk.user.entity.SearchUserEntity;
import com.maruping.disk.user.exception.EmailRepeatException;
import com.maruping.disk.user.exception.MobileRepeatException;
import com.maruping.disk.user.exception.UserNameRepeatException;
import com.maruping.disk.user.exception.UserOccupyException;

import java.util.List;

public interface UserService {
    List<PtUserEntity> queryUserList();
    void deleteUserByIds(String ids) throws UserOccupyException;
    TblResponseEntity<PtUserEntity> queryUserInfoListByPage(SearchUserEntity entity, PagingEntity paging);
    PtUserEntity queryUserInfoById(String userUuid);
    void modifyUserInfoById(PtUserEntity entity) throws EmailRepeatException, MobileRepeatException, UserNameRepeatException;
    void addUserInfo(PtUserEntity entity) throws EmailRepeatException, MobileRepeatException, UserNameRepeatException;
    List<ZtreeEntity> queryRoleTreeListByUser(String userUuid);
    void saveRoleRefUser(String userUuidArray, String roleUuidArray);
    void resetPasswords(String userUuids) throws Exception;
    PtUserEntity queryUserInfoByName(String username);

    /**
     * 修改用户密码（带旧密码验证）
     * @param userEntity 包含用户UUID和新密码的用户实体
     * @param oldPassword 旧密码（明文）
     * @throws Exception 当旧密码不正确或其他错误时抛出
     */
    void changePassword(PtUserEntity userEntity, String oldPassword) throws Exception;
}